package com.ittx.dzt.baidu.consumer;

import com.ittx.dzt.baidu.consumer.handler.BaiduBatchSplitHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 数据批量转单个消费者父类
 * <p>
 *
 * </p>
 *
 * @author wl_code@163.com
 * @version 1.0
 * @date 2025/2/27
 */
@Slf4j
public abstract class AbstractBatchSplitConsumer implements RocketMQListener<String> {

	@Autowired
	BaiduBatchSplitHandler baiduBatchSplitHandler;

	@Override
	public void onMessage(String message) {
		baiduBatchSplitHandler.onMessage(message, this.getLogsStr());
	}

	/**
	 * 获取日志字符串
	 *
	 * @return
	 */
	public abstract String getLogsStr();
}
